package 力扣日常刷题.木22一月.第16天0128;

/**
 * @author 帅小伙
 * @date 2022/1/28
 * @description
 * 顺序拼接两个字符串数组  比较两个字符串是否相等
 */
public class Demo19字符串简单检查两个字符串数组是否相等 {


    public boolean arrayStringsAreEqual(String[] word1, String[] word2) {
        StringBuffer sb1 = new StringBuffer();
        StringBuffer sb2 = new StringBuffer();
        for (int i = 0; i < word1.length; i++) {
            sb1.append(word1[i]);
        }
        for (String s : word2) {
            sb2.append(s);
        }
        return sb1.toString().equals(sb2.toString());
    }

}
